package cn.lg.soar.cms.biz.modules.other.entity;

import cn.lg.soar.core.annotations.constraints.group.Create;
import cn.lg.soar.core.annotations.constraints.group.Update;
import cn.lg.soar.database.base.entity.BaseEntity;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

/**
 * 页面元素位置
 * @author luguoxiang
 * @since 2025-02-23
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@Data
@Schema(description = "页面元素位置")
@TableName("lg_cms_block")
public class Block extends BaseEntity {

    /**  */
    @NotNull(message = "主键不能为空", groups = { Update.class })
    @ExcelIgnore
    @Schema(description = "主键")
    @TableId
    private Long id;

    /** 名称 */
    @NotBlank(message = "名称不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "名称")
    @Schema(description = "名称")
    private String name;

    /** 位置编码 */
    @NotBlank(message = "位置编码不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "位置编码")
    @Schema(description = "位置编码")
    private String code;

    /** 描述 */
    @ExcelProperty(value = "描述")
    @Schema(description = "描述")
    private String description;

    /** 高度 */
    @ExcelProperty(value = "高度")
    @Schema(description = "高度")
    private Integer height;

    /** 宽度 */
    @ExcelProperty(value = "宽度")
    @Schema(description = "宽度")
    private Integer width;

    @JsonIgnore
    @Override
    public Long primaryKey() {
        return this.id;
    }

}
